package com.esri.core.symbol;

import com.esri.core.internal.util.d;
import java.io.StringWriter;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;

/* loaded from: classes.dex */
public class SimpleLineSymbol extends LineSymbol {
    public static final String TYPE = "esriSLS";
    private static final long serialVersionUID = 1;
    private STYLE d;

    /* loaded from: classes.dex */
    public enum STYLE {
        DASH("esriSLSDash"),
        DASHDOT("esriSLSDashDot"),
        DASHDOTDOT("esriSLSDashDotDot"),
        DOT("esriSLSDot"),
        NULL("esriSLSNull"),
        SOLID("esriSLSSolid");
        
        private String a;

        @Override // java.lang.Enum
        public String toString() {
            return this.a;
        }

        STYLE(String str) {
            this.a = str;
        }

        public static STYLE fromString(String str) {
            if (str == null) {
                return null;
            }
            if ("esriSLSDash".equals(str)) {
                return DASH;
            }
            if ("esriSLSDashDot".equals(str)) {
                return DASHDOT;
            }
            if ("esriSLSDashDotDot".equals(str)) {
                return DASHDOTDOT;
            }
            if ("esriSLSDot".equals(str)) {
                return DOT;
            }
            if ("esriSLSNull".equals(str)) {
                return NULL;
            }
            if ("esriSLSSolid".equals(str)) {
                return SOLID;
            }
            return null;
        }
    }

    public SimpleLineSymbol(JsonNode jsonNode) throws Exception {
        super(jsonNode);
        this.d = null;
        setStyle(STYLE.fromString(d.a(jsonNode, "style")));
    }

    public SimpleLineSymbol(int i, float f) {
        this.d = null;
        setColor(i);
        setWidth(f);
    }

    public SimpleLineSymbol(int i, float f, STYLE style) {
        this(i, f);
        setStyle(style);
    }

    public SimpleLineSymbol setStyle(STYLE style) {
        this.d = style;
        return this;
    }

    public STYLE getStyle() {
        return this.d;
    }

    public SimpleLineSymbol(SimpleLineSymbol simpleLineSymbol) {
        this(simpleLineSymbol.getColor(), simpleLineSymbol.getWidth());
        this.c = simpleLineSymbol.c;
        this.d = simpleLineSymbol.d;
    }

    @Override // com.esri.core.symbol.Symbol
    public String toJson() throws Exception {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator a = d.a(stringWriter);
        a.writeStartObject();
        d.a(a, "type", TYPE);
        STYLE style = this.d;
        if (style != null) {
            d.a(a, "style", style.toString());
        }
        super.a(a);
        a.writeEndObject();
        a.close();
        return stringWriter.toString();
    }

    @Override // com.esri.core.symbol.LineSymbol
    public int hashCode() {
        int hashCode = super.hashCode() * 31;
        STYLE style = this.d;
        return hashCode + (style == null ? 0 : style.hashCode());
    }

    @Override // com.esri.core.symbol.LineSymbol
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        return super.equals(obj) && getClass() == obj.getClass() && this.d == ((SimpleLineSymbol) obj).d;
    }

    @Override // com.esri.core.symbol.Symbol
    public Symbol copy() throws Exception {
        return new SimpleLineSymbol(this);
    }
}
